{**
 * SDTT.tpl: hien thi cho xem cac tai khoan trong DMuc
 *
 * Copyright (c) 2003-2012 John Willinsky
 * Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
 *
 * Display list of sections in journal management.
 *
 * $Id$
 *}

{strip}
{assign var="pageTitle" value="S&#7889; d&#432; Tài khoản "}
{assign var="socot" value="6"}
{include file="common/header.tpl"}
{/strip}
<div id = "search" style= "text-align: center; padding: 10px 20px ; width:100%; color: #458B74" >
<strong style="font-size: 2em;" >S&#7888; D&#431; TÀI KHOẢN {$xNam}</strong>


<form method="post" action="{url nam= $xNam }">
	&nbsp;&nbsp;&nbsp;
	<br>
	<br>
	<select name="searchField" size="1" class="selectMenu">
		{html_options options=$fieldOptions selected=$searchField}
	</select>
	<select name="searchMatch" size="1" class="selectMenu">
		<option value="contains"{if $searchMatch == 'contains'} selected="selected"{/if}>C&#243; ch&#7913;a</option>
		<option value="is"{if $searchMatch == 'is'} selected="selected"{/if}>L&#224;</option>
		<option value="startsWith"{if $searchMatch == 'startsWith'} selected="selected"{/if}>B&#7855;t &#273;&#7847;u l&#224; </option>
	</select>
	<input type="text" size="10" name="search" class="textField" value="{$search|escape}" />&nbsp;<input id= "search" type="submit" value="{translate key="common.search"}" class="button" />
</form>
</div>

<br>
<br>


<div id = "create" style="display: none; width:80%;  margin-left: auto; margin-right: auto;">
	<table width="100%" style = " border: thin black solid;">
	<tr valign="top" height = "40px">
	<td colspan = "2" id = "create_title" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-size: 1.5em; font-weight: bold; border-width: 0;" > Thêm Số dư Tài khoản</td>
	</tr>

	<tr valign="top">
		<td width="20%" class="label" style = "text-align: right;"><label for="matk">T&#224;i Kho&#7843;n:*</label></td>

		<td width="80%" class="value">
		<select name="matk" id="matk" class="selectMenu">
		{html_options options=$taikhoan|truncate:80 }
		</select></td>
	</tr>
	
	<tr valign="top">
		<td class="label" style = "text-align: right;"><label for="dknovn">S&#7889; d&#432; n&#7907;  :</label></td>
		<td class="value"><input type="text" name="dknovn" value="" id="dknovn" pattern="[0-9.]+" size="40" maxlength="120" class="textField" onkeypress="return isNumberKey(event)" onblur="return validSoTien(this.value, this.id);"/></td>
		<td ></td>
	</tr>




	<tr valign="top">
		<td class="label" style = "text-align: right;"><label for="dkcovn">S&#7889; dư có:</label></td>
		<td class="value"><input type="text" name="dkcovn" value="" id="dkcovn" size="40" maxlength="120" class="textField" onkeypress="return isNumberKey(event)" onblur="return validSoTien(this.value, this.id);" /></td>
		<td ></td>
	</tr>


	<tr valign="top" height = "40px">
	<td colspan = "2" width="100%" style = "text-align: center; padding: 10px 20px ; width:100%; color: #458B74;font-weight: bold;"> 
	<input type="button" id = "createbutton" value="Thêm mới" class="button defaultButton" onclick="SaveNew('{$host}', '{$username}', '{$password}', '{$databaseName}', '{$urlIns}', '{$xNam}', '{$journalid}');" /> <input type="button" value="{translate key="common.cancel"}" class="button defaultButton" onclick="RTFcreate();" />
	</td></tr>

	</table>
	<br>
	<br>
</div> 

<div id = "btnThem"> 
<table width = "80%" align = "center">
<tr>
<td width = "50%">

	<input type="button" id="button_id" value="Th&#234;m Số dư"  class="button" style= "text-align: left;"  onClick="create();"> 
</td>
<td width = "50%" style= "text-align: right; 	font-weight: bold;">
<label >{$searchSql}</label>
<a class="action" href="#">K&#7871;t chuy&#7875;n s&#7889; d&#432; t&#7915; n&#259;m {$xNamT}</a>
</td>
</tr>
</table>
	</div>


<div id="sections">

<table width="80%" class="listing" id="customers" align = "center">
	
	<tr class="heading" valign="bottom">
		<th width="10%">M&#227; T&#224;i kho&#7843;n</th>
		<th width="10%">Tên T&#224;i kho&#7843;n</th>
		<th width="10%">Đầu kỳ N&#7907; </th>
		<th width="10%">Đầu kỳ Có </th>
		<th width="15%" align="right">{translate key="common.action"}</th>
	</tr>
	
	{assign var="stt" value=0}
	{if $dtE}
		{iterate from=datas item=data name=datas}
		{assign var = "matk" value = $data->getmatk()|escape}
		{assign var="stt" value=$stt+1}
		<tr valign="top" id="sdtt-{$data->getmatk()}" class="data">
			{assign var = "matk" value = $data->getmatk()}
			<td class="drag">{$matk|escape}</td>
			<td class="drag" >{$data->gettentk()|escape}</td>
			<td class="drag" style="text-align:right">{$data->getdknovn()|number_format:0:".":"."}</td>
			<td class="drag" style="text-align:right">{$data->getdkcovn()|number_format:0:".":"."}</td>


			<td align="right" class="nowrap">
				<a href="#" id ={$stt} class="action" onclick="edit(this.id)" >{translate key="common.edit"}</a>&nbsp;|&nbsp;
				<a class="action" id ={$stt} href="javascript:void(0);" onclick="deledata('{$host}', '{$username}', '{$password}', '{$databaseName}', '{$xNam}', '{$journalid}',  '{$matk}',  '{$urlDel}', '{$urlRFR}');"  class="action">{translate key="common.delete"}</a>
			</td>

			
		</tr>
		{/iterate}
	{else}
		<tr valign="top" class="data" height = "15px">
		<td class="drag">{$matk|escape}</td>
			<td class="drag" ></td>
			<td class="drag" ></td>
			<td class="drag" ></td>


			<td class="drag" ></td>
		</tr>

	{/if}




<tr>
	<td colspan="{$socot}" class="endseparator">&nbsp;</td>
</tr>

</table>
</div>

{include file="common/footer.tpl"}

